package com.xz.coursearrange.entity.request;

import com.xz.coursearrange.common.validation.AddGroup;
import com.xz.coursearrange.common.validation.UpdateGroup;
import lombok.Data;

import javax.validation.constraints.*;
import java.io.Serializable;

/**
 * @Descripe:
 */
@Data
public class ClassTaskDTO implements Serializable {

    private static final long serialVersionUID = -4023200004755949854L;

    /**
     * id
     */
    @NotNull(message = "ID不能为空", groups = UpdateGroup.class)
    private Integer id;

    /**
     * 学期
     */
    @NotBlank(message = "学期不能为空", groups = AddGroup.class)
    private String semester;

    /**
     * 年级
     */
    @NotBlank(message = "年级不能为空", groups = AddGroup.class)
    private String gradeNo;

    /**
     * 班级编号
     */
    @NotBlank(message = "班级编号不能为空", groups = AddGroup.class)
    private String classNo;

    /**
     * 课程编号
     */
    @NotBlank(message = "课程编号不能为空", groups = AddGroup.class)
    private String courseNo;

    /**
     * 课程名称
     */
    @NotBlank(message = "课程名称不能为空", groups = AddGroup.class)
    @Size(min = 2,max = 10,message = "课程名称长度不能超过10",groups = {AddGroup.class,UpdateGroup.class})
    private String courseName;

    /**
     * 讲师编号
     */
    @NotBlank(message = "讲师编号不能为空", groups = AddGroup.class)
    private String teacherNo;

    /**
     * 讲师名字
     */
    @NotBlank(message = "讲师姓名不能为空", groups = AddGroup.class)
    @Size(min = 2,max = 10,message = "讲师姓名长度不能超过10",groups = {AddGroup.class,UpdateGroup.class})
    private String realname;

    /**
     * 课程属性
     */
    @NotBlank(message = "课程属性不能为空")
    @Pattern(regexp = "01|02|03|04", message = "课程属性只能是01、02、03或04")
    private String courseAttr;

    /**
     * 上课人数
     */
    @NotNull(message = "上课人数不能为空", groups = AddGroup.class)
    @Min(value = 1, message = "上课人数必须大于0", groups = {AddGroup.class, UpdateGroup.class})
    private Integer studentNum;

    /**
     * 周学时
     */
    @NotNull(message = "周学时不能为空", groups = AddGroup.class)
    @Min(value = 1, message = "周学时必须大于0", groups = {AddGroup.class, UpdateGroup.class})
    private Integer weeksNumber;

    /**
     * 周数
     */
    @NotNull(message = "周数不能为空", groups = AddGroup.class)
    @Min(value = 1, message = "周数必须大于0", groups = {AddGroup.class, UpdateGroup.class})
    private Integer weeksSum;

    /**
     * 是否固定上课时间
     */
    @NotBlank(message = "是否固定上课时间不能为空", groups = AddGroup.class)
    @Pattern(regexp = "1|2", message = "是否固定上课时间只能是1或2", groups = {AddGroup.class, UpdateGroup.class})
    private String isFix;

    /**
     * 固定时间的话时间是什么时候
     */
    private String classTime;
}
